// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   GraphicsProvider.java

package com.java4less.rchart.gc;

import com.java4less.rchart.gc.android.ChartAndroidColor;
import com.java4less.rchart.gc.android.ChartAndroidFont;
import com.java4less.rchart.gc.android.ChartAndroidGraphics;
import com.java4less.rchart.gc.android.ChartAndroidImage;

// Referenced classes of package com.java4less.rchart.gc:
//			ChartColor, ChartFont, ChartGraphics, ChartImage

public class GraphicsProvider
{

	public static int MODE_AWT_SWING;
	public static int MODE_SWT = 1;
	public static int MODE_AWT1;
	private static int mode;

	public GraphicsProvider()
	{
	}

	public static void setMode(int m)
	{
		mode = m;
	}

	public static int getMode()
	{
		return mode;
	}

	public static ChartColor getColor(String c)
	{
		return new ChartAndroidColor(c);
	}

	public static ChartColor getColor(int red, int green, int blue)
	{
		return new ChartAndroidColor(red, green, blue);
	}

	public static ChartColor getColorFromObject(Object o)
	{
		return new ChartAndroidColor(o);
	}

	public static ChartFont getFont(String c, int style, int size)
	{
		return new ChartAndroidFont(c, style, size);
	}

	public static ChartFont getFontFromObject(Object o)
	{
		return new ChartAndroidFont(o);
	}

	public static ChartGraphics getGraphics(Object o)
	{
		return new ChartAndroidGraphics(o);
	}

	public static ChartImage getImage(Object o)
	{
		return new ChartAndroidImage(o);
		Exception e;
		e;
		e.printStackTrace();
		return null;
	}

	public static ChartImage getImageFromFile(String file)
	{
		return new ChartAndroidImage(file);
		Exception e;
		e;
		e.printStackTrace();
		return null;
	}

	public static ChartImage createImage(int w, int h)
	{
		return new ChartAndroidImage(w, h);
	}

	public static ChartImage createTransparentImage(int w, int h, ChartColor transparent)
	{
		return new ChartAndroidImage(w, h, transparent);
	}

	public static void startUIThread(Runnable r)
	{
		(new Thread(r)).start();
	}

	static 
	{
		MODE_AWT_SWING = 0;
		MODE_AWT1 = 2;
		mode = MODE_AWT_SWING;
		String javaVersion = System.getProperty("java.version");
		if (javaVersion.indexOf("1.1") == 0)
			setMode(MODE_AWT1);
	}
}
